package train.time0622;

import java.util.LinkedList;

public class No1 {
	public static void main(String[] args) {
		LinkedList<Integer> list = new LinkedList<Integer>();
		for (int i = 0; i < 500; i++) {
			list.add(i+1);
		}
		for (int i = 2; list.size()>1; i+=2) {
			while(i>list.size()-1){
				i=i%list.size();
			}
			//System.out.println(list.get(i));
			list.remove(i);
		}
		System.out.println(list.get(0));
	}

}
